package com.ruoyi.system.api.factory;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.RemoteMapperUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @author sss
 * @description 供电所系统用户服务降级
 * @date 2022/7/27
 */
public class RemoteMapperUserFallbackFactory implements FallbackFactory<RemoteMapperUserService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteMapperUserFallbackFactory.class);

    @Override
    public RemoteMapperUserService create(Throwable throwable) {
        log.error("调用供电所系统用户服务失败:{}", throwable.getMessage());
        return new RemoteMapperUserService() {
            @Override
            public AjaxResult getMapperUserByUserNameAndIntegsysCode(String userName, String integsysCode) {
                return null;
            }
        };
    }
}
